package com.tarena.dubbo.order.web.controller;

import com.tarena.dubbo.order.web.pojo.Order;
import com.tarena.dubbo.order.web.service.OrderService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Api("dubbo订单")
public class OrderController {
    @Autowired
    private OrderService orderService;
    @PostMapping("/create/order")
    @ApiOperation(value = "创建订单")
    //创建订单
    public String createOrder(@RequestBody Order order) {
        orderService.createOrder(order);
        return "finished";
    }
}
